<template>
  <div>
    <div>
      <div class="text-container">
        <p>{{ messegeContent.feedback }}</p>
      </div>
      <div class="img-container">
        <img
          v-for="(path, index) in messegeContent.feedbackPicList"
          :key="index"
          :src="path"
        />
      </div>
    </div>
    <div v-if="messegeContent.status === 0" class="reply-container">
      <a-textarea
        v-model="replyText"
        placeholder="回复"
        :rows="4"
        @change="changeText"
      />
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component, Prop } from 'vue-property-decorator'

@Component
export default class MessegeModal extends Vue {
  @Prop({ default: () => ({}) })
  messegeContent!: any

  private replyText: string = ''

  public changeText() {
    this.$emit('replyTextChanged', this.replyText)
  }
}
</script>

<style lang="less" scoped>
.text-container {
  min-height: 100px;
}

.img-container {
  align-items: center;
  display: flex;
  flex-direction: row;
  height: 200px;
  overflow-x: auto;

  img {
    margin-right: 10px;
    max-height: 100%;
  }
}

.reply-container {
  margin-top: 20px;
}
</style>
